package datamining.code.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class OracleConnection {
	public static OracleConnection instance = null;

    public static OracleConnection getInstance() {
        if (instance == null) {
            instance = new OracleConnection();
        }
        return (instance);
    }

    private static String url = "jdbc:oracle:thin:@localhost:1521:xe";
    private static String pass = "root";
    private static String user = "datamining";
    private static String driver = "oracle.jdbc.OracleDriver";

    public static Connection getConnection() {
        Connection conn = null;
        try {
            Class.forName(driver);
            conn = DriverManager.getConnection(url, user, pass);
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
        return conn;
    }

}
